<?php
class Pageley_Domain_Exception extends Pageley_Util_NestedException {
	private $errors;
	
	public function __construct($errors = null) {
	    if($errors === null) {
	        $errors = new Pageley_Util_ArrayMap();
	    } else if(!($errors instanceof Pageley_Util_Map)) {
	        $errors = new Pageley_Util_ArrayMap($errors);
	    }
		$this->errors = $errors;
	}
	
	public function getErrors() {
		return $this->errors;
	}
	
	public function __toString() {
		return $this->errors->__toString();
	}
}